# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=indent
pkgver=2.2.13
pkgrel=2
pkgdesc="An indenting utility"
url="https://www.gnu.org/software/indent/"
# ppc64le: segfaults in tests
arch="all !ppc64le"
license="GPL-3.0-or-later"
makedepends="gettext-dev texinfo"
subpackages="$pkgname-doc $pkgname-lang"
source="https://ftp.gnu.org/gnu/indent/indent-$pkgver.tar.xz"

prepare() {
	default_prepare
	update_config_sub
}

build() {
	CFLAGS="$CFLAGS -flto=auto" \
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--disable-dependency-tracking
	make
}

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir" install
}

sha512sums="
a92028f99cc64b451aac99802de564f2e915e7f0e258df761141f77595c07cc95c3f2c35917618dbc2cfa3aa5b163544e07aa6641c32298aca3a1c5331bb8c69  indent-2.2.13.tar.xz
"
